home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual FX for Image FX
/
VisualFX for Image FX 3 - Disc 2.iso
/
setup
/
setup01.rexx
next >
Wrap
OS/2 REXX Batch file
|
1997-02-11
|
10KB
|
409 lines
/*
Visual FX
For
Image FX
SetUp Script
Written By J.L. White
(C)1997 Merlin's Software
*/
signal on error
signal on syntax
parse arg CurrentFX VolumeNum TotalNum Frames Fields
options results
Quote = '22'X
address "IMAGEFX.1"
ScreenToFront
FlyOn = 0
Compression = -1
Frames = strip(Frames)
Fields = strip(Fields)
AddPadding = -1
call FXSetUp()
if exists("libs:flyer.library") then do
if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
RequestNotify 'Flyer Must Be Running First!'
exit
end
call OpenFlyStuff()
Title = "Effect #"right(CurrentFX,2,'0')" From Volume #"strip(VolumeNum)
Gadget.1 = 'I/150/18/Number of Frames:/'Frames
Gadget.2 = 'X/258/20/Use Field Rendering?/'Fields
Gadget.3 = 'D/110/40/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
Gadget.4 = 'D/110/60/120/ImageB Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
Gadget.5 = 'D/308/50/120/Save As/2/FLYER CLIP/SEQUENCE'
Gadget.6 = 'L/135/86/1/2/'Title
ComplexRequest '"Visual FX SetUp Options"' 6 Gadget 450 100
if rc ~= 0 then do
call CloseStuff()
exit 0
end
else do
Frames = RESULT.1
Field = RESULT.2
IAType = RESULT.3
IBType = RESULT.4
SaveType = RESULT.5
end
end
else do
Title = "Effect #"right(CurrentFX,2,'0')" From Volume #"strip(VolumeNum)
Gadget.1 = 'I/150/18/Number of Frames:/30'
Gadget.2 = 'X/280/20/Use Field Rendering?/1'
Gadget.3 = 'D/110/40/120/ImageA Type/2/FRAME/SEQUENCE'
Gadget.4 = 'D/340/40/120/ImageB Type/2/FRAME/SEQUENCE'
Gadget.5 = 'L/150/66/1/2/'Title
ComplexRequest '"Visual FX SetUp Options"' 5 Gadget 480 80
if rc ~= 0 then do
exit 0
end
else do
Frames = RESULT.1
Field = RESULT.2
IAType = RESULT.3+2
IBType = RESULT.4+2
SaveType = 1
end
end
call GetA()
call GetB()
call GetS()
call SaveTemp()
if FlyOn = 1 then
call CloseStuff()
ScreenToBack
EXIT 0
FXSetUp:
FXSName = "VFXIFXCD:SetUp/"right(strip(VolumeNum),2,'0')"/"right(strip(CurrentFX),2,'0')".rexx"
if exists(FXSName) then do
address command "sys:rexxc/rx >NIL: "FXSName" "strip(TotalNum)".txt"
end
return
YesOrNo: procedure
parse Arg Title,Yes,No
Address FLY_1 OK_TEXT Yes
Address FLY_1 CANCEL_TEXT No
Address FLY_1 AskYesNoNT Title
if result = "OK" then YesNo = 1
else YesNo = 0
return YesNo
FindDrive:
address command "C:Info >RAM:DriveList"
call open TempFile,"RAM:DriveList",R
do until eof(TempFile)
line = readln(TempFile)
parse var line Drive" "Rest
if Drive = "FA0:" then
FlyVolume = word(Rest,7)":"
end
call close TempFile
address command "Delete >NIL: RAM:DriveList"
return FlyVolume
OpenFlyStuff:
FlyOn = 1
address command "run VFXIFXCD:FLY"
do while (POS('FLY_1',SHOW('Ports')) = 0)
address command "wait 1"
end
TOASTERLIB="ToasterARexx.port"
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT' , 0)
call addlib(TOASTERLIB,0)
DriveName = FindDrive()
return
GetFile:
parse Arg Title, Path
Address FLY_1 SetString Path
Address FLY_1 GetFileNameNT Title
return result
GetA:
if IAType = 0 then do
call Switcher(TOSW)
PicAName = GetFile("Select Flyer Clip For ImageA! ",DriveName)
Name = GetFileName(PicAName)
if Name = "" then do
Address FLY_1 OK_TEXT " OK "
Title = "You Must Enter A Valid Clip Name To Use!"
Address FLY_1 FYINT Title
Address FLY_1 Quit
call Switcher(TOWB)
exit
end
Address FLY_1 SetFileName PicAName
Address FLY_1 GetClipLength PicAName
End = result
Start = (End+2) - Frames
Address FLY_1 Program "5"
Address FLY_1 StartNum Start
Address FLY_1 EndNum End
Address FLY_1 CurrentNum "-1"
FTitle = "(Default Is Last "Frames" Frames)"
Address FLY_1 GetTimeNT "Select Frame To Start With For ImageA!\"center(FTitle,38,' ')
StartA = ((word(result,1))*2)
End = word(result,2)
call addlib('PROJECT_REXX_PORT' , 0)
call addlib(TOASTERLIB,0)
call Switcher(TOWB)
address command "C:Wait 1"
ScreenToFront
end
if IAType = 1 then do
RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
PicAName = result
Name = GetFileName(PicAName)
if Name = "" then do
Title = "You Must Enter A Valid Name To Use!"
RequestNotify Title
if FlyOn = 1 then Address FLY_1 Quit
exit
end
StartA = 0
end
if IAType = 2 then do
RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
PicAName = result
Name = GetFileName(PicAName)
if Name = "" then do
Title = "You Must Enter A Valid Name To Use!"
RequestNotify Title
if FlyOn = 1 then Address FLY_1 Quit
exit
end
StartA = 0
end
if IAType = 3 then do
RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
PicAName = result
Name = GetFileName(PicAName)
if Name = "" then do
Title = "You Must Enter A Valid Name To Use!"
RequestNotify Title
if FlyOn = 1 then Address FLY_1 Quit
exit
end
RequestNumber '"Select Frame Number To Start With!"' 1
StartA = result-1
end
return
GetB:
if IBType = 0 then do
call Switcher(TOSW)
DriveName = GetPathName(PicAName)
PicBName = GetFile("Select Flyer Clip For ImageB! ",DriveName)
Name = GetFileName(PicBName)
if Name = "" then do
Address FLY_1 OK_TEXT " OK "
Title = "You Must Enter A Valid Clip Name To Use!"
Address FLY_1 FYINT Title
Address FLY_1 Quit
call Switcher(TOWB)
exit
end
Address FLY_1 SetFileName PicBName
Address FLY_1 GetClipLength PicBName
End = result
Address FLY_1 Program "5"
Address FLY_1 StartNum 0
Address FLY_1 EndNum End
Address FLY_1 CurrentNum "-1"
FTitle = "(Default Is First "Frames" Frames)"
Address FLY_1 GetTimeNT "Select Frame To Start With For ImageB!\"center(FTitle,38,' ')
StartB = ((word(result,1))*2)
End = word(result,2)
call addlib('PROJECT_REXX_PORT' , 0)
call addlib(TOASTERLIB,0)
call Switcher(TOWB)
address command "C:Wait 1"
ScreenToFront
end
if IBType = 1 then do
DriveName = GetPathName(PicAName)
RequestFile '"Select Flyer Still For ImageB!"' DriveName ' '
PicBName = result
Name = GetFileName(PicBName)
if Name = "" then do
Title = "You Must Enter A Valid Name To Use!"
RequestNotify Title
if FlyOn = 1 then Address FLY_1 Quit
exit
end
StartB = 0
end
if IBType = 2 then do
DriveName = GetPathName(PicAName)
RequestFile '"Select FileName For ImageB!"' DriveName ' '
PicBName = result
Name = GetFileName(PicBName)
if Name = "" then do
Title = "You Must Enter A Valid Name To Use!"
RequestNotify Title
if FlyOn = 1 then Address FLY_1 Quit
exit
end
StartB = 0
end
if IBType = 3 then do
DriveName = GetPathName(PicAName)
RequestFile '"Select BaseName For ImageB! "' DriveName ' '
PicBName = result
Name = GetFileName(PicBName)
if Name = "" then do
Title = "You Must Enter A Valid Name To Use!"
RequestNotify Title
if FlyOn = 1 then Address FLY_1 Quit
exit
end
RequestNumber '"Select Frame Number To Start With!"' 1
StartB = result-1
end
return
GetSName:
SaveName = GetFile("Enter Flyer Clip Name To Save! ",DriveName)
Name = GetFileName(SaveName)
if Name = "" then do
Address FLY_1 OK_TEXT " OK "
Title = "You Must Enter A Valid Clip Name To Save!"
Address FLY_1 FYINT Title
Address FLY_1 Quit
call Switcher(TOWB)
exit
end
if exists(SaveName) then do
Answer = YesOrNo(" Are You Sure You Want To \ OverWrite "SaveName"?"," YES "," NO ")
if Answer = 0 then do
call GetSName()
return
end
Answer = YesOrNo(" Are You Positive?"," YES "," NO ")
if Answer = 1 then do
address command "Delete >NIL: "SaveName
if exists(SaveName".I") then
address command "Delete >NIL: "SaveName".I"
end
if Answer = 0 then do
call GetSName()
return
end
end
return
GetS:
if SaveType = 0 then do
if substr(DriveName,1,1) ~= "F" then
DriveName = FindDrive()
call Switcher(TOSW)
call GetSName()
Address FLY_1 GetCompressionNT
Compression = result
if Compression = 2 then Compression = 0
Answer = YesOrNo("Do You Want To Add Padding\To Beginning & End Of Clip?"," YES "," NO ")
if Answer = 1 then do
AddPadding = GetText("Enter Number Of\ Frames To Use","30")
end
call addlib('PROJECT_REXX_PORT' , 0)
call addlib(TOASTERLIB,0)
call Switcher(TOWB)
address command "C:Wait 1"
ScreenToFront
end
if SaveType = 1 then do
DriveName = GetPathName(PicBName)
RequestFile '"Select BaseName To Save "' DriveName ' '
SaveName = result
Name = GetFileName(SaveName)
if Name = "" then do
Title = "You Must Enter A Valid Name To Use!"
RequestNotify Title
if FlyOn = 1 then Address FLY_1 Quit
exit
end
end
return
GetText:
parse Arg Title, Text
Address FLY_1 SetString Text
Address FLY_1 GetStringNT Title
return result
CloseStuff:
Address FLY_1 Quit
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
return
SaveTemp:
address command "Copy >NIL: VFXIFXCD:Arexx/"right(strip(VolumeNum),2,'0')"/"right(strip(CurrentFX),2,'0')".rexx to RAM:VFXTEMP"
call open TempFile,"Ram:VFXTEMP",A
call writeln TempFile,"Settings:"
call writeln TempFile," Compression="Compression
call writeln TempFile," Frames="Frames
call writeln TempFile," Field="Field
call writeln TempFile," IAType="IAType
call writeln TempFile," PicAName="Quote""PicAName""Quote
call writeln TempFile," StartA="StartA
call writeln TempFile," IBType="IBType
call writeln TempFile," PicBName="Quote""PicBName""Quote
call writeln TempFile," StartB="StartB
call writeln TempFile," SaveType="SaveType
call writeln TempFile," SaveName="Quote""SaveName""Quote
call writeln TempFile," Volume="strip(VolumeNum)
call writeln TempFile," CurrentFX="strip(CurrentFX)
call writeln TempFile," FXNum="strip(TotalNum)
call writeln TempFile," Padding="strip(AddPadding)
call writeln TempFile,"return"
call close TempFile
return
GetPathName: procedure
ARG CompleteName
c = lastpos("/",CompleteName)
if c = 0 then c = lastpos(":",CompleteName)
return left(CompleteName,c)
GetFileName: procedure
ARG CompleteName
c = lastpos("/",CompleteName)
if c = 0 then c = lastpos(":",CompleteName)
return substr(CompleteName, c + 1)
syntax:
error:
Title = "An Error Was Found With This Script On Line #"SIGL"!"
if SIGL != 35 then RequestNotify Title
if FlyOn = 1 then
Address FLY_1 Quit
exit